package com.ea.eadp.nexus.test.pageDefinition.newconsole;

import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;


public class ReoptinPage extends ConsoleBasePage {
    public final static String contactMeCheckBox = "contactMe";

    public ReoptinPage(WebDriver driver) {
        super(driver, ReoptinPage.class, "label-contactMe");
    }

    public void selectOptin(boolean contactMe) {
        log.info("Select Contact Me CheckBox");
        sendControllerKey(Keys.UP);
        if (getStatusForCheckBox(contactMeCheckBox) != contactMe) {
            selectCheckBox(contactMeCheckBox);
        }
        sendControllerKey(Keys.DOWN);
        sendControllerKey('A');
    }
}